<%@ include file="../common/IncludeTop.jsp"%>

<script type="text/javascript" src="js/jquery-3.6.0.js"></script>
<script type="text/javascript">
	$(function () {
		var $code = $("#code_image");
		$code.click(function (){
			this.src = "kaptcha.jpg?" + new Date();
		});
	});
</script>

<div id="Catalog">
	<form action="account?action=checkAccount" method="post">
		<p>Please enter your username and password.</p>
		<table>
			<tr>
				<th>Username:</th>
				<td>
					<input id="username" type="text" name="username" value="${sessionScope.usernameEntered}">
				</td>
			</tr>
			<tr>
				<th>Password:</th>
				<td><input type="password" name="password" value="${sessionScope.passwordEntered}"/></td>
			</tr>

			<tr>
				<th>Verification code:</th>
				<td>
					<input type="text" name="code" style="width: 60px">
					<img id="code_image" style="width: 88px;height: 22px;position: absolute;+margin-top:1px;margin-left: 5px" src="kaptcha.jpg">
				</td>
			</tr>
			<c:if test="${sessionScope.codeError != null}">
				<tr>
					<td colspan="2"  style="color: red">${sessionScope.codeError}</td>
				</tr>
			</c:if>
			<c:if test="${sessionScope.accountNotExist != null}">
				<tr>
					<td colspan="2"  style="color: red">${sessionScope.accountNotExist}</td>
				</tr>
			</c:if>
		</table>
		<td colspan="2"><input type="submit" name="signon" value="Login" ></td>
	</form>

	Need a user name and password?
	<a href="account?action=viewRegisterPage">Register Now!</a>
</div>

<%@ include file="../common/IncludeBottom.jsp"%>

